Defect detection systems find defects in an image of an object to be inspected, denoted O in the present specification, such as a reticle, wafer, PCB or other patterned object. The patterned object is typically formed in accordance with a digital precursor thereof. Defects in the image are found by comparing the image, denoted I in the present specification, of the object O, to another, reference image, denoted R, DB or "database" in the present specification. The reference image R is sometimes modified, as by translation, scaling and/or rotation, prior to the defect detection process to bring it into accordance with the image I. Alternatively or in addition, the image I may be modified prior to defect detection to bring I into accord with R. Scaling and rotation transformations are typically applied to the image R.
Typically, discrepancies between the image I and the reference image R have more than one origin. Possible origins of discrepancies between the I and R images include the following:
a. Inaccuracies of the apparatus employed to generate the object O to be inspected from its digital precursor. PA1 b. Inaccuracies of the imaging apparatus employed to generate the image I from the object O, such as mechanical vibrations and optical distortions. PA1 c. Inaccuracies in generating the reference image R from a precursor thereof, such as rounding errors. PA1 d. Differences of scale, offset or orientation between image I and reference image R. PA1 e. Defects in the object O. PA1 I. Computing I-R difference for each translation of each comparison entity: For each comparison entity and for each translation, comparing the comparison entity, and the location in R corresponding to that translation, by obtaining a difference measure. For example, the sum of differences of corresponding pixel values may be used as a difference measure. PA1 II. Computing I-R difference for each comparison entity: Computing a difference measure for each comparison entity by combining the difference measures for each translation considered for that comparison entity. For example, the comparison entity difference measure may be defined as the minimum of all the difference measures corresponding to all translations considered for that comparison entity. PA1 III. Finding defects: Providing an indication of defects using the comparison entity difference measures. For example, a defect may be indicated for a particular comparison entity if its difference measure value exceeds some predetermined threshold. PA1 a. Expected differences compensation: If the compensation for expected differences is good, high similarity requirements may be imposed in the comparison stage I, and consequently, sensitive defect detection may be achieved. Various factors affect the quality of expected difference compensation. For example, shape and size of the comparison entities may affect accuracy of compensation for translation errors. PA1 b. Defect compensation: If differences due to defects are compensated for, they may not be identified as defects in the comparison stage. Therefore, a scheme that minimizes defect compensation increases detection sensitivity. PA1 c. Comparison accuracy: If the comparison procedure of step II above is accurate, high-sensitivity defect detection may be achieved. Conversely, if noise accumulates in the course of the comparison step, comparison thresholds must be increased, with consequent reduction in sensitivity. PA1 a. Computing a correlation function on large windows in I and R, where the function is computed at whole pixel intervals, thereby to obtain a sampled correlation surface. PA1 b. Finding the minimum point of the sampled correlation surface. PA1 c. Fitting a quadratic surface to points in the neighborhood of the minimum point, in order to compute a subpixel minimum point or line. PA1 d. Using the subpixel location to compute a subpixel translation, to be applied to reference image R. PA1 e. Once the two images are aligned, the two images are compared, using the following substeps: PA1 a. Errors in computing the translation: The Specht method does not always find the minimum point of the continuous correlation surface. The quadratic surface fitting is done in the neighborhood of the minimum of the sampled correlation surface. However, these two minimum points may not be adjacent. In such cases a false alignment transformation may be chosen, causing false alarms in the comparison step. Therefore, Specht et al cannot reliably handle images which include certain problematic geometries. Sample problematic images are images that contain mostly edges in a first direction and only a small number of short edges in a second perpendicular direction. PA1 b. Insufficient expected difference compensation: The comparison entity is a large region. The same translation is applied to all its points. Hence, some expected discrepancies cannot be compensated for, e.g. edge related discrepancies. This reduces detection sensitivity. PA1 c. Reduced comparison accuracy: If more than one edge falls within the 2.times.2 comparison window, the magnitude of expected differences is higher and a higher threshold must be used. Therefore, the detection sensitivity for small defects is low for dense images or image portions. PA1 a. Existence of defect compensation: Due to the small size of the comparison entity (3.times.3 window), defects may sometimes be compensated for, with resulting loss of sensitivity. Enlarging the window would not be a satisfactory solution. Since differences are summed over the entire window, the accumulation of inaccuracies over a large window would be too large. PA1 b. Insufficient expected differences compensation: If more than one edge falls within the window, there is no way to compensate for edge related expected discrepancies. As a consequence, the expected difference is relatively large, and larger comparison thresholds are used in such cases. This results in reduced sensitivity for images comprising dense geometries. PA1 Directional edges: an edge in one of the x, y, 45 and 135 degree directions. In other words, there are four types of directional edges. PA1 Directional toggles: a pixel value sequence of high-low-high or of low-high-low in a specific direction. In other words, there are eight types of directional toggles because there are two toggle types for each of four directions (x, y, 45 degrees and 135 degrees). PA1 Clear field: A location in which there are no directional edges and no directional toggles. PA1 a. The method is not operative to detect defects generally. Only those defects which affect the specific features defined by Whil et al are found. PA1 b. The operators used to compute the features cover a relatively large area of the image. Therefore, the method of Whil et al is not effective for dense images or dense image portions. PA1 c. Feature generation depends on the specific placement of the sampling grid, which may vary when the comparison process is repeated. Therefore, the comparison process is not reliably repeatable. PA1 A. Compute numerical image location difference values: Compute an image location difference value for each of a plurality of small units, also termed herein image locations, defined within the comparison entity. The image location difference value of a small unit represents the difference between that small unit in I and a corresponding small unit in R. For example, in conventional defect detection systems, the small unit is a pixel and the image location difference value of each pixel may comprise either the square or the absolute value of the difference between the value of that pixel in the comparison entity and the value of the pixel corresponding thereto in R. PA1 B. Combine image location difference values: The local values computed in the comparison entity are combined over the small units, thereby to obtain a single difference measure for the comparison entity. PA1 i. Transform the numerical image location difference values computed in step A to boolean image location difference values by thresholding. Specifically, the boolean image location difference value may be "true" (1) if the numerical image location difference value does not exceed a threshold and the boolean image location difference value may be "false" (0) if the numerical image location difference value is greater than the threshold. PA1 ii. AND the boolean image location difference values, thereby to obtain a single boolean or binary difference measure for the comparison entity. PA1 taking the maximum over all the image location difference values; and PA1 applying the threshold to the maximum in order to obtain a single boolean difference measure for the comparison entity. PA1 a. `true` (1), indicating that it is legitimate for an image location, i.e. that it translates the image location to a similar DB location; or a value of PA1 b. `false` (0), indicating that the translation is not legitimate for the particular image location, i.e. that the DB location to which the image location is translated is not similar to the image location. PA1 1. Good Compensation for expected differences: The size of regions used as comparison entities in the regional comparison process of the present invention is chosen to enhance compensation for expected differences. The local comparison process further enhances compensation for expected differences by compensating at the level of individual edges. PA1 2. Low level of defect compensation: In the regional process, region size is selected to be large enough to reduce the level of defect compensation, for defects of all types, and also small enough to substantially prevent compensation for misplaced edges. In the local comparison process, the length of edges used as comparison entities is selected to be large enough to reduce the level of compensation for the local-type defects, as defined above, which the local process detects. PA1 3. Processing speed: Due to the accuracy of the comparison step (step I), the system can process images with dense geometries. Also, for images with less dense geometries, pixel size can be enlarged with consequent increase in processing speed. PA1 4. Simple implementation: The two-level apparatus shown and described herein, including a comparison-entity level and an image-location level, provides relatively simple and efficient manipulation of boolean values. For example, the comparison-entity level uses at least some of the boolean values computed at the image-location level at least twice, corresponding to the at least two comparison entities overlapping at an individual image location. PA1 for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 announcing a defect for the comparison entity if none of the plurality of translations are legitimate therefor. PA1 summing the comparison entity legitimacy values of each individual translation from among the plurality of translations, over a plurality of adjacent comparison entities, and PA1 selecting at least one translation with a relatively high sum of comparison entity legitimacy values. PA1 for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 announcing a defect for the comparison entity if none of the translations thereof are legitimate. PA1 comparing each individual one of a multiplicity of comparison entities of a first type in the first digital representation to at least one corresponding location in the second digital representation, the correspondences between the individual comparison entity of the first type and the at least one locations in the second digital representation respectively defining at least one transformations from the first digital representation to the second digital representation, PA1 comparing each individual one of a multiplicity of comparison entities of a second type in the first digital representation to at least one corresponding location in the second digital representation, the at least one locations in the second digital representation corresponding respectively to the at least one transformations applied to the individual comparison entity of the second type, and PA1 providing an output indication of differences between the first and second digital representations in accordance with the results of the comparing steps, PA1 wherein the two comparing steps are performed in parallel. PA1 I. for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 II. announcing a defect for the comparison entity if none of the translations thereof are legitimate. PA1 for each individual location from among a multiplicity of locations within the first digital representation, determining at least one best translation from the first digital representation to the second digital representation for translating the individual location, and PA1 announcing an alignment error if the at least one best translations of a plurality of adjacent locations are mutually discrepant. PA1 A. for each individual translation from among a plurality of translations from the first digital representation to the second digital representation: PA1 B. improving the alignment of the first and second digital representations by operating an individual translation on the individual large location, wherein the individual translation is selected from the plurality of translations on the basis of the success score of the individual translation for the individual large location. PA1 a per-image location translation legitimacy determining unit operative to generate, for each individual translation from among a plurality of translations from the first digital representation to the second digital representation and for each individual image location from among a plurality of image locations within a comparison entity within the first digital representation, a binary legitimacy value of the individual translation for the individual image location, PA1 a per-comparison entity translation legitimacy determining unit operative to combine the binary legitimacy values of image locations within the comparison entity, thereby to generate a comparison entity legitimacy value determining whether the individual translation is legitimate for the comparison entity, and PA1 a defective comparison entity announcing unit operative to announce a defect for the comparison entity if none of the plurality of translations are legitimate therefor. PA1 a per-image location translation legitimacy determining unit operative, for each individual translation from among a plurality of translations from the first digital representation to the second digital representation and for each individual image location from among a plurality of image locations within a comparison entity within the first digital representation, to determine legitimacy of the individual translation for the individual image location by comparing the individual image location to a location in the second digital representation defined by operating the individual translation on the individual image location, PA1 a non-linear legitimacy combining unit operative to generate a nonlinear combination of the legitimacies of all image locations within the comparison entity, thereby defining the legitimacy of the individual translation for the comparison entity, and PA1 a defective comparison entity announcing unit operative to announce a defect for the comparison entity if none of the translations thereof are legitimate. PA1 first-type comparison entity comparing apparatus operative to compare each individual one of a multiplicity of comparison entities of a first type in the first digital representation to at least one corresponding location in the second digital representation, the correspondences between the individual comparison entity of the first type and the at least one locations in the second digital representation respectively defining at least one transformations from the first digital representation to the second digital representation, PA1 second-type comparison entity comparing apparatus operative to compare each individual one of a multiplicity of comparison entities of a second type in the first digital representation to at least one corresponding location in the second digital representation, the at least one locations in the second digital representation corresponding respectively to the at least one transformations applied to the individual comparison entity of the second type, and PA1 a difference announcer operative to provide an output indication of differences between the first and second digital representations in accordance with output received from the comparing apparatus, wherein the two comparing apparatus operate in parallel. PA1 wherein, for each individual translation from among a plurality of translations from the first digital representation to the second digital representation and for each individual image location from among a plurality of image locations within a comparison entity within the first digital representation: PA1 a per-image location translation legitimacy determining unit operative to determine the legitimacy of an individual translation for an individual image location in accordance with the outputs of the image location comparison unit and of the geometrical complexity evaluator for the individual translation and for the individual image location, PA1 a per-comparison entity translation legitimacy determining unit operative to combine the legitimacies of all image locations within an individual comparison entity, thereby defining the legitimacy of the individual translation for the comparison entity, and PA1 a defective comparison entity announcer operative to announce a defect for the comparison entity if none of the translations thereof are legitimate. PA1 a per-large location success score generator operative to generate a success score for each individual translation from among a plurality of translations from the first digital representation to the second digital representation, the success score representing the success of the individual translation in translating the individual large location, the success score generator including: PA1 an alignment unit operative to improve the alignment of the first and second digital representations by operating an individual translation on an individual large location, wherein the individual translation is selected from the plurality of translations on the basis of the success score of the individual translation for the individual large location.
It is often very difficult to differentiate between discrepancies between the I and R images which are the result of defects in the object O, and discrepancies between the I and R images which have other origins, as detailed in (a)-(d) above. A discrepancy of the second type is also termed herein an "expected difference". In other words, an expected difference is a discrepancy between I and R which falls into one of categories (a) to (d) above. One type of expected difference between I and R images is an expected translation error. An expected translation error occurs when corresponding portions of the I and R images "drift".
State of the art approaches to defect detection may be classified as either "compensate and compare" approaches or "features" approaches. The word "compensate" is intended to refer to a characteristic of "compensate and compare" approaches whereby expected differences between compared objects are anticipated or allowed for and are not considered defects. The two approaches may be employed separately or in combination. The two approaches are now described.